//
//  UIImageView+Extension.swift
//  Test
//
//  Created by ZWJY on 2021/8/20.
//

import Foundation
import UIKit

// MARK: - 快速创建UIImageView
public extension UIImageView{

    convenience init(img: UIImage?, contentMode: ContentMode = .scaleToFill) {
        self.init()
        self.image = img
        self.contentMode = contentMode
        self.isUserInteractionEnabled = true
    }

    func pg_image(_ image: UIImage?) -> Self {
        self.image = image
        return self
    }
    
    func pg_contentMode(_ contentMode: ContentMode) -> Self {
        self.contentMode = contentMode
        return self
    }
}
